#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <stack>
#include <string>
#include <vector>
#include <queue>
#include <unordered_map>
using namespace std;

class Solution {
public:
    vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
        unordered_map<int, int> mp;
        for (auto e : nums1)
        {
            mp[e]++;
        }
        vector<int> ret;
        for (auto e : nums2)
        {
            auto tmp = mp.find(e);
            if (tmp != mp.end() && tmp->second != 0)
            {
                ret.push_back(e);
                tmp->second = 0;
            }
        }
        return ret;
    }
};


int main()
{
	return 0;
}
